# -!- coding: utf-8 -!-
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
海拍客调用小贷接口响应信息
#文件：response_api_hipac.py
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

# 授信结果通知
credit_notify = {
    "activeStatus":0,
    "businessLicenseUrl":"https://msbuc.oss-cn-shenzhen.aliyuncs.com/test/meson/hipac/picture/personal_info/2020-01-20/living/1579513463069.png",
    "creditAmount":0,
    "creditDate":1582099571369,
    "creditExpires":1582099571369,
    "creditNo":"MSXDHIPAC20200120Abn45q32R785",
    "creditStatus":2,
    "custMobile":"13828784074",
    "custName":"金成云",
    "foodCirculationLicenseUrl":"https://msbuc.oss-cn-shenzhen.aliyuncs.com/test/meson/hipac/picture/personal_info/2020-01-20/living/1579513480582.png",
    "merchantAddress":"北京市朝阳区塔无酒望甲1号18层B-2101",
    "merchantCode":"91440300071122857U",
    "merchantName":"深圳海水科技有限公司",
    "merchantNo":"002646",
    "message":"授信拒绝",
    "requestId":"00000101919"
}
# 用信结果通知
pay_notify = {
    "loanApply":0,
    "loanNo":"HIPAC20200223125950954J4S4",
    "loanStatus":0,
    "merchantNo":"002647",
    "message":"放款申请成功",
    "requestId":"20200223001"
}
# 还款结果通知（主动还款）
repay_notify = {
    "code":0,
    "fee":0.0,
    "loanNo":"HIPAC202001171746422742F25",
    "mchNo":"002647",
    "message":"还款成功",
    "overdueDays":5,
    "penalty":3.25,
    "planId":0,
    "principal":1303.25,
    "repayAmount":1303.25,
    "repayDate":1582194827994,
    "repayNo":"202002201833471820290781",
    "repayType":0
}

# 贷款详情
loan_detail ={
    "code":"0000",
    "message":"成功",
    "productNo":"P0002",                # 002分期
    "loanStatus":0,                     # 贷款状态：0-贷款成功(等待放款)，1-贷款失败，2-贷款关闭
    "loanAmount":1000.0,                # 借款本金
    "loanDate":"2020-02-22T07:25:34.000+0000",
    "wiredTime":None,
    "loanPeriod":3,
    "loanPeriodType":1,
    "wiredStatus":0,                    # 打款状态：0-等待处理，1-打款中，2-已到帐，3-已关闭
    "loanRate":0.99,
    "loanPenaltyRate":0.05,
    "repayPlanList":[
        {
            "repayNo":None,             # 未还款前为空（退货）
            "originalAmount":333.33,    # 初始本金
            "originalFee":9.9,          # 初始利息/费用
            "interestAmount":333.33,    # 应还本金：
            "interestFee":9.9,          # 应还利息/费用
            "rawAmount":343.23,         # 实际还款金额(应还本金+费用+罚息)
            "rawFee":9.9,               # 实际还款利息/费用
            "penaltyFee":0.0,           # 罚息费用
            "repayDate":"2020-02-23T06:45:42.000+0000",
            "planId":1,
            "repayStatus":1,            # 还款状态：0-待还款(未还款/逾期)，1-已还款
            "overdueFlag":0,            # 0-正常，1-逾期
            "overdueDays":0
        },
        {
            "repayNo":None,
            "originalAmount":333.33,
            "originalFee":9.9,
            "interestAmount":333.33,
            "interestFee":9.9,
            "rawAmount":0.0,
            "rawFee":0.0,
            "penaltyFee":0.0,
            "repayDate":None,
            "planId":2,
            "repayStatus":0,
            "overdueFlag":0,
            "overdueDays":0
        },
        {
            "repayNo":None,
            "originalAmount":333.34,
            "originalFee":9.9,
            "interestAmount":333.34,
            "interestFee":9.9,
            "rawAmount":0.0,
            "rawFee":0.0,
            "penaltyFee":0.0,
            "repayDate":None,
            "planId":3,
            "repayStatus":0,
            "overdueFlag":0,
            "overdueDays":0
        }
    ],
    "repayResult":0                  # 还款结果：0-待结清，1-已结清 (批扣时 海拍客通过这个接口更新借据状态)
}

# 退货申请
refund_apply = {
    "code":"0000",
    "message": "成功",
    "refundNo": "T0026472001",
    "refundStatus": 0,               # 退货状态：0-退货成功，1-等待确认，2-退货失败，3-订单放款中
    "refundType": 1,                 # 0-全部退货,1-部分退货
    "interestAmount":1,              # 原退货金额
    "interestFee":1,                 # 原退货利息/费用
    "amount": 0,                     # 实际退货金额：原退货金额-费用-罚息(如果有)
    "fee": 1,                        # 实际退货利息/费用
    "penaltyFee": 0.0,               # 罚息费用
    "overdueDays":0,                 # 逾期天数
}